<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>实现仿京东搜索框</title>
	</head>
	<body>
		<input type="text">
		<script>
			var searchInput = document.querySelector('input');
			document.addEventListener('keyup',function(e){
				console.log(e.keyCode);
				// 按按键s聚焦到input框中
				if (e.keyCode === 83){
					searchInput.focus();
				}
				if (e.keyCode === 13){
					alert('我执行搜索了');
				}
			})
			
		</script>
		
	</body>
</html>